package com.sgx.learning.luban.homework.basictype;

import lombok.Getter;

import java.io.IOException;
import java.io.InputStream;

public class U1 {

    @Getter
    private byte value;

    public U1(byte v) {
        this.value = v;
    }

    public static U1 read(InputStream is) throws IOException {
        byte[] v = new byte[1];
        try {
            is.read(v);
            return new U1(v[0]);
        } catch (IOException e) {
            throw e;
        }
    }

}
